<!--
 * @Descripttion: 
 * @Date: 2022-02-01 09:24:29
 * @LastEditors: sueRimn
 * @LastEditTime: 2022-02-01 10:30:13
 * @Author: 作者:刘洋(L13831467435@163.com)
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>上传文件</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
  <!-- 引入样式 -->
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />
  <!-- 引入组件库 -->
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>

<body>
  <div id="app">
    <el-upload class="upload-demo" :action="http" :on-preview="handlePreview" :on-remove="handleRemove" multiple
      :file-list="fileList">
      <el-button size="small" type="primary">点击上传</el-button>
      <div slot="tip" class="el-upload__tip">
        传给我使劲的传
      </div>
    </el-upload>
  </div>
</body>
<script>
  var app = new Vue({
    el: "#app",
    data() {
      return {
        // http: 'http://localhost:3000/upload',
        http: 'http://39.107.113.49:3000/upload',
        fileList: [],
      };
    },
    methods: {
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePreview(file) {
        console.log(file);
      },
    },
  });
</script>

</html>